<?php 
/**
* 
*/

class A
{
	public $src;
	public $width=300;
	public $heigth=300;
	public $size=100;
	public $line;
	public $dian;
	public function show($size=100,$width=200,$heigth=100,$line=20,$dian=100)
	{
		$this->dian=$dian;
		$this->line=$line;
		$this->size=$size;
		$this->width=$width;
		$this->heigth=$heigth;
		$this->_HB();
		$this->_color();
		$this->_line();
		$this->_dian();
		$this->_zt();
		$this->_out();
	}
	public function _HB()
	{
		header("Content-type: image/png");

		$src = imageCreateTrueColor($this->width,$this->heigth); 

		$this->src=$src;
	}
	public function _color()
	{
		 $color = imageColorAllocate($this->src,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255));

		imagefill($this->src , 0, 0, $color );
	}
	public function _line()
	{
		for ($i=0; $i < $this->line; $i++) { 
		$color = imageColorAllocate($this->src,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255));
		imageline ( $this->src , mt_rand(0,$this->width) , mt_rand(0,$this->width) , mt_rand(0,150), mt_rand(0,100) , $color );
		}
	}
	public function _dian()
	{
		for ($i=0; $i < $this->dian; $i++) { 
		$color = imageColorAllocate($this->src,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255));
		imagesetpixel ( $this->src , mt_rand(0,200) ,mt_rand(0,100) ,$color ) ;
		}
	}
	public function _zt()
	{
		for ($i=0; $i < 4; $i++) { 
		$color = imageColorAllocate($this->src,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255));
		$add='qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567980';
		$arr=$add[mt_rand(0,strlen($add)-1)];
		$width=$i*43;
		$width+=10;
		$heigth=mt_rand(80,90);
		imagettftext ( $this->src ,$this->size, mt_rand(-10,10) ,$width, $heigth ,$color ,'../03-14/JustBrains.ttf',$arr);
		}
	}
	public function _out()
	{
		imagepng($this->src);
	}
}



 ?>